﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ControlesAWIL
{
    public partial class VentanaTextBox : Form
    {
        public bool ok = false;
        
        public String Texto
        {
            get { return this.msTextBox.Text; }
            set {
                this.msTextBox.Text = value; 
            }
        }

        public int TextoMaxLength
        {
            get { return this.msTextBox.MaxLength; }
            set {
                if (value > 0 && value < 30000)
                {
                    this.msTextBox.MaxLength = value;
                }
                else
                {
                    this.msTextBox.MaxLength = 30000;
                }
            }
        }

        public Boolean TextoEnabled
        {
            get { return this.msTextBox.Enabled; }
            set { this.msTextBox.Enabled = value; }
        }

        public Boolean TextoReadOnly
        {
            get { return this.msTextBox.ReadOnly; }
            set { this.msTextBox.ReadOnly = value; }
        }


        public VentanaTextBox()
        {
            InitializeComponent();
        }

        private void VentanaTextBox_Shown(object sender, EventArgs e)
        {
        }

        private void VentanaTextBox_FormClosing(object sender, FormClosingEventArgs e)
        {
            e.Cancel = true;
            this.Visible = false;
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            this.ok = true;
            this.Hide();
        }
    }
}
